home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / TeX-inputs / Plain / tugboat.cmn < prev    next >
Text File  |  1996-08-27  |  32KB  |  1,009 lines

  1. %% @latexfile{
  2. %%     filename="tugboat.cmn",
  3. %%     version="1.13h",
  4. %%     date="10-Nov-1995",
  5. %%     filetype="common macros for TUGboat",
  6. %%     copyright="Copyright (C) TeX Users Group.
  7. %%            Copying of this file is authorized only if either:
  8. %%            (1) you make absolutely no changes to your copy, OR
  9. %%            (2) if you do make changes, you first rename it to some
  10. %%                other name.",
  11. %%     author="TeX Users Group",
  12. %%     address="TeX Users Group,
  13. %%            1850 Union Street, \#1637,
  14. %%            San Francisco, CA 94123,
  15. %%            USA",
  16. %%     telephone="415-982-8449",
  17. %%     email="Internet: TUGboat@ams.org",
  18. %%     codetable="ISO/ASCII",
  19. %%     checksumtype="line count",
  20. %%     checksum="1008",
  21. %%     keywords="tex users group, tugboat, common macros",
  22. %%     abstract="This file contains macros common to both
  23. %%            the PLAIN and LaTeX style files for TUGboat,
  24. %%            the Communications of the TeX Users Group.
  25. %%            Among other things, it contains supplementary
  26. %%            definitions for abbreviations and logos that
  27. %%            appear in TUGboat."
  28. %%     }
  29. %%
  30. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  31.  
  32. \def\fileversion{v1.13h}
  33. \def\filedate{10 Nov 1995}
  34.  
  35. \message{File `TUGBOAT.CMN' \fileversion \space\space <\filedate>}
  36.  
  37. %
  38. %               *****     TUGBOAT.CMN   *****
  39. %
  40. %       See the bottom of the file (after \endinput) for a list of
  41. %       items defined.
  42. %       
  43.  
  44. % *************************************************************************
  45.  
  46. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  47. %
  48. %     *****  helpful shorthand  *****
  49. %
  50.  
  51. %  The following allow for easier changes of category.  These require that
  52. %  the character be addressed as a control-sequence: e.g. \makeescape\/ will
  53. %  make the / an escape character.
  54.  
  55. \def\makeescape#1{\catcode`#1=0 }
  56. \def\makebgroup#1{\catcode`#1=1 }
  57. \def\makeegroup#1{\catcode`#1=2 }
  58. \def\makemath#1{\catcode`#1=3 }
  59. \def\makealign#1{\catcode`#1=4 }
  60. \def\makeeol#1{\catcode`#1=5 }
  61. \def\makeparm#1{\catcode`#1=6 }
  62. \def\makesup#1{\catcode`#1=7 }
  63. \def\makesub#1{\catcode`#1=8 }
  64. \def\makeignore#1{\catcode`#1=9 }
  65. \def\makespace#1{\catcode`#1=10 }
  66. \def\makeletter#1{\catcode`#1=11 }
  67. \def\makeother#1{\catcode`#1=12 }
  68. \def\makeactive#1{\catcode`#1=13 }
  69. \def\makecomment#1{\catcode`#1=14 }
  70.  
  71. \def\makeatletter{\catcode`\@=11 }      % included for historical reasons
  72. \chardef\other=12
  73. \def\makeatother{\catcode`\@=\other}
  74.  
  75.                                         % alternative to localization
  76. \def\savecat#1{%
  77.   \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}}
  78. \def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname}
  79.  
  80.  
  81. \savecat\@
  82. \makeletter\@           % used, as in PLAIN, in protected control sequences
  83.  
  84.                         % for restoring meanings of global control sequences
  85. \def\SaveCS#1{%
  86.   \def\scratch{\expandafter\let\csname saved@@#1\endcsname}%
  87.   \expandafter\scratch\csname#1\endcsname}
  88. \def\RestoreCS#1{%
  89.   \def\scratch{\expandafter\let\csname#1\endcsname}%
  90.   \expandafter\scratch\csname saved@@#1\endcsname}
  91.  
  92.  
  93. % To distinguish between macro files loaded
  94.  
  95. \def\plaintubstyle{plain}
  96. \def\latextubstyle{latex}
  97. \ifx\tugstyloaded@\undefined\let\tugstyloaded@\plaintubstyle\fi
  98.  
  99. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  100. %
  101. %     *****  abbreviations and logos  *****
  102. %
  103.  
  104. \def\acro#1{{\SMC #1}\spacefactor1000 }
  105.  
  106. \def\AllTeX{(\La)\TeX}
  107.  
  108. \def\AMS{American Mathematical Society}
  109.  
  110. \def\AmS{{\the\textfont2 A}\kern-.1667em\lower.5ex\hbox
  111.         {\the\textfont2 M}\kern-.125em{\the\textfont2 S}}
  112. \def\AmSLaTeX{\AmS-\LaTeX}
  113. \def\AmSTeX{\AmS-\TeX}
  114.  
  115. \def\aw{A\kern.1em-W}
  116. \def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley}
  117.  
  118. \def\BibTeX{{\rm B\kern-.05em{\smc i\kern-.025emb}\kern-.08em\TeX}}
  119.  
  120. \def\CandT{{\sl Computers \& Typesetting}}
  121.  
  122. \def\CTAN{\acro{CTAN}}
  123.  
  124. \def\DVItoVDU{DVIto\kern-.12em VDU}
  125.  
  126. \def\HTML{\acro{HTML}}
  127.  
  128. \def\ISBN{\acro{ISBN} }
  129. \def\ISSN{\acro{ISSN} }
  130.  
  131. %       Japanese TeX
  132. \def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}}
  133.  
  134. \def\JoT{{\sl The Joy of \TeX}}
  135.  
  136. \def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em\the\scriptfont2 A}%
  137.     \kern-.2em\lower.376ex\hbox{\the\textfont2 M}\kern-.125em
  138.     {\the\textfont2 S}-\TeX}
  139.  
  140. %       note -- \LaTeX definition is from LATEX.TEX 2.09 of 7 Jan 86,
  141. %               adapted for additional flexibility in TUGboat
  142. %\def\LaTeX{\TestCount=\the\fam \leavevmode L\raise.42ex
  143. %       \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}\kern-.15em\TeX}
  144. %       note -- broken in two parts, to permit separate use of La,
  145. %               as in (La)TeX
  146. \def\La{\TestCount=\the\fam \leavevmode L%
  147.         \setbox\TestBox=\hbox{$\fam\TestCount\scriptstyle A$}%
  148.         \kern-.5\wd\TestBox\raise.42ex\box\TestBox}
  149. \def\LaTeX{\La\kern-.15em\TeX}
  150. \def\LaTeXe{\LaTeX{}\kern.05em2$_{\textstyle\varepsilon}$}
  151.  
  152. %       for Robert McGaffey
  153. \def\Mc{\setbox\TestBox=\hbox{M}M\vbox to\ht\TestBox{\hbox{c}\vfil}}
  154.  
  155. \font\manual=logo10 % font used for the METAFONT logo, etc.
  156. \def\MF{{\manual META}\-{\manual FONT}\spacefactor1000 }
  157. \def\MP{{\manual META}\-{\manual POST}\spacefactor1000 }
  158. \def\mf{{\smc Metafont}}
  159. \def\MFB{{\sl The \slMF book}}
  160.  
  161. %       multilingual (INRS) TeX
  162. \def\mtex{T\kern-.1667em\lower.5ex\hbox{\^E}\kern-.125emX\spacefactor1000 }
  163.  
  164. \def\PDF{\acro{PDF}}
  165.  
  166. \def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3ptc}MF\spacefactor1000 }
  167. \def\PCTeX{PC\thinspace\TeX}
  168. \def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3ptc}\TeX}
  169.  
  170. \def\Pas{Pascal}
  171.  
  172. \def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\spacefactor1000 }
  173. \def\PiCTeX{\PiC\kern-.11em\TeX}
  174.  
  175. \def\plain{{\tt plain}}
  176.  
  177. \def\POBox{P.\thinspace O.~Box }
  178. \def\POBoxTUG{\POBox\unskip~9506, Providence, RI~02940}
  179.  
  180. \def\PS{{Post\-Script}}
  181.  
  182. \def\SC{Steering Committee}
  183.  
  184. \def\SGML{\acro{SGML}}
  185.  
  186. \def\SliTeX{{\rm S\kern-.06em{\smc l\kern-.035emi}\kern-.06em\TeX}}
  187.  
  188. \def\slMF{\MF}
  189. %       Use \font\manualsl=logosl10 instead, if it's available,
  190. %       for \def\slMF{{\manualsl META}\-{\manualsl FONT}\spacefactor1000 }
  191.  
  192. %       Atari ST (Klaus Guntermann)
  193. \def\stTeX{{\smc st\rm\kern-0.13em\TeX}}
  194.  
  195. \def\TANGLE{{\tt TANGLE}\spacefactor1000 }
  196.  
  197. \def\TB{{\sl The \TeX book}}
  198. \def\TP{{\sl \TeX\/}: {\sl The Program\/}}
  199.  
  200. \def\TeX{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\spacefactor1000 }
  201.  
  202. \def\TeXhax{\TeX hax}
  203.  
  204. %       Don Hosek
  205. \def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}\kern-.2267emG%
  206.         \spacefactor1000 }
  207.  
  208. %\def\TeXtures{\TestCount=\the\fam
  209. %       \TeX\-\hbox{$\fam\TestCount\scriptstyle TURES$}}
  210. \def\TeXtures{{\it Textures}}
  211. \let\Textures=\TeXtures
  212.  
  213. \def\TeXXeT{\TeX-{}-\XeT}
  214.  
  215. \def\ttn{{\sl TTN}\spacefactor1000 }
  216. \def\TTN{{\sl \TeX{} and TUG NEWS}\spacefactor1000 }
  217.  
  218. \def\tubfont{\sl}               % redefined in other situations
  219. \def\TUB{{\tubfont TUGboat\/}}
  220.  
  221. \def\TUG{\TeX\ \UG}
  222.  
  223. \def\UG{Users Group}
  224.  
  225. \def\UNIX{\acro{UNIX}}
  226.  
  227. \def\VAX{V\kern-.12em A\kern-.1em X\spacefactor1000 }
  228.  
  229. \def\VorTeX{V\kern-2.7pt\lower.5ex\hbox{O\kern-1.4pt R}\kern-2.6pt\TeX}
  230.  
  231. \def\XeT{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT\spacefactor1000 }
  232.  
  233. \def\WEB{{\tt WEB}\spacefactor1000 }
  234. \def\WEAVE{{\tt WEAVE}\spacefactor1000 }
  235.  
  236.  
  237.  
  238. %********************************************************************
  239.  
  240. \newlinechar=`\^^J
  241. \normallineskiplimit=1pt
  242.  
  243. \clubpenalty=10000
  244. \widowpenalty=10000
  245.  
  246. \def\NoParIndent{\parindent=\z@}
  247. \newdimen\normalparindent        \normalparindent=20pt          % plain = 20pt
  248. \def\NormalParIndent{\global\parindent=\normalparindent}
  249. \NormalParIndent
  250.  
  251. \def\BlackBoxes{\overfullrule=5pt }
  252. \def\NoBlackBoxes{\overfullrule=\z@ }
  253. \def\newline{\hskip\z@ plus \pagewd \break}
  254. \def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M}
  255.  
  256. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  257. %
  258. %     *****  utility registers and definitions  *****
  259. %
  260.  
  261. %       test registers for transient use; paired - internal/external
  262. \newbox\T@stBox                 \newbox\TestBox
  263. \newcount\T@stCount             \newcount\TestCount
  264. \newdimen\T@stDimen             \newdimen\TestDimen
  265. \newif\ifT@stIf                 \newif\ifTestIf
  266.  
  267.  
  268. %       \cs existence test, stolen from TeXbook exercise 7.7
  269. \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }
  270.  
  271. % LaTeX conventions which are also useful here.
  272. \ifx\tugstyloaded@\plaintubstyle
  273.   \let\@@input\input
  274.   \def\iinput#1{\@@input#1 }
  275.   \def\@inputcheck{\if\@nextchar\bgroup
  276.     \expandafter\iinput\else\expandafter\@@input\fi}
  277.   \def\input{\futurelet\@nextchar\@inputcheck}
  278. \fi
  279.  
  280. %       Smashes repeated from AMS-TeX; PLAIN implements only full \smash .
  281. \newif\iftop@           \newif\ifbot@
  282. \def\topsmash{\top@true\bot@false\smash@}
  283. \def\botsmash{\top@false\bot@true\smash@}
  284. \def\smash{\top@true\bot@true\smash@}
  285. \def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
  286.         \else\let\next\makesm@sh\fi \next }
  287. \def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}
  288.  
  289.  
  290. %       Vertical `laps'; cf. \llap and \rlap
  291. \long\def\ulap#1{\vbox to \z@{\vss#1}}
  292. \long\def\dlap#1{\vbox to \z@{#1\vss}}
  293.  
  294. %       And centered horizontal and vertical `laps'
  295. \def\xlap#1{\hbox to \z@{\hss#1\hss}}
  296. \long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
  297. \long\def\zlap#1{\ylap{\xlap{#1}}}
  298.  
  299.  
  300. %       Avoid unwanted vertical glue when making up pages.
  301. \def\basezero{\baselineskip\z@skip \lineskip\z@skip}
  302.  
  303.  
  304. %  Empty rules for special occasions
  305. \def\nullhrule{\hrule height\z@ depth\z@ width\z@ }
  306. \def\nullvrule{\vrule height\z@ depth\z@ width\z@ }
  307.  
  308. %       Support ad-hoc strut construction.
  309. \def\makestrut[#1;#2]{\vrule height#1 depth#2 width\z@ }
  310.  
  311. %       Construct box for figure pasteup, etc.
  312. %       height = #1, width = #2, rule thickness = #3
  313. \def\drawoutlinebox[#1;#2;#3]{\T@stDimen=#3
  314.         \vbox to#1{\hrule height\T@stDimen depth\z@
  315.             \vss\hbox to#2{\vrule width\T@stDimen
  316.                 \hfil\makestrut[#1;\z@]%
  317.                 \vrule width\T@stDimen}\vss
  318.             \hrule height\T@stDimen depth\z@}}
  319.  
  320.  
  321. %       Today's date, to be printed on drafts.  Based on TeXbook, p.406.
  322.  
  323. \def\today{\number\day\space \ifcase\month\or
  324.         Jan \or Feb \or Mar \or Apr \or May \or Jun \or
  325.         Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi
  326.         \number\year}
  327.  
  328. %       Current time; this may be system dependent!
  329. \newcount\hours
  330. \newcount\minutes
  331. \def\SetTime{\hours=\time
  332.         \global\divide\hours by 60
  333.         \minutes=\hours
  334.         \multiply\minutes by 60
  335.         \advance\minutes by-\time
  336.         \global\multiply\minutes by-1 }
  337. \SetTime
  338. \def\now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes}
  339.  
  340. \def\Now{\today\ \now}
  341.  
  342. \newif\ifPrelimDraft            \PrelimDraftfalse
  343.  
  344. \def\midrtitle{\ifPrelimDraft {{\tensl preliminary draft, \Now}}\fi}
  345.  
  346. %  Section heads.  The following set of macros is used to set the large
  347. %  TUGboat section heads (e.g. "General Delivery", "Fonts", etc.)
  348.  
  349. \newdimen\PreTitleDrop   \PreTitleDrop=\z@
  350.  
  351. \newskip\AboveTitleSkip  \AboveTitleSkip=12pt
  352. \newskip\BelowTitleSkip  \BelowTitleSkip=8pt
  353.  
  354. \newdimen\strulethickness       \strulethickness=.6pt
  355. \def\sthrule{\hrule height\strulethickness depth \z@ }
  356. \def\stvrule{\vrule width\strulethickness }
  357.  
  358. \newdimen\stbaselineskip        \stbaselineskip=18pt
  359.  
  360. \def\@sectitle #1{%
  361.   \par \SecTitletrue
  362.   \penalty-1000
  363.   \secsep
  364.   \vbox{
  365.     \sthrule
  366.     \hbox{%
  367.       \stvrule
  368.       \vbox{
  369.         \advance\hsize by -2\strulethickness
  370.         \raggedcenter
  371.         \def\\{\unskip\break}%
  372.         \sectitlefont
  373.         \makestrut[2\stfontheight;\z@]
  374.         #1\unskip
  375.         \makestrut[\z@;\stfontheight]\endgraf
  376.         }%
  377.       \stvrule }
  378.     \sthrule }
  379.   \nobreak
  380.   \vskip\baselineskip }
  381.  
  382. %  distance between articles which are run together
  383. \def\secsep{\vskip 5\baselineskip}
  384.  
  385. \newif\ifSecTitle
  386. \SecTitlefalse
  387.  
  388.  
  389.  
  390. %  Registration marks
  391.  
  392. \def\HorzR@gisterRule{\vrule height 0.2pt depth \z@ width 0.5in }
  393. \def\DownShortR@gisterRule{\vrule height 0.2pt depth 1pc width 0.2pt }
  394. \def\UpShortR@gisterRule{\vrule height 1pc depth \z@ width 0.2pt }
  395.  
  396.  
  397. %               ``T'' marks centered on top and bottom edges of paper
  398.  
  399. \def\ttopregister{\dlap{%
  400.         \hbox to \trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
  401.                         \HorzR@gisterRule \hfil \HorzR@gisterRule}%
  402.         \hbox to \trimwd{\hfil \DownShortR@gisterRule \hfil}}}
  403. \def\tbotregister{\ulap{%
  404.         \hbox to \trimwd{\hfil \UpShortR@gisterRule \hfil}%
  405.         \hbox to \trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
  406.                         \HorzR@gisterRule \hfil \HorzR@gisterRule}}}
  407.  
  408. \def\topregister{\ttopregister}
  409. \def\botregister{\tbotregister}
  410.  
  411.  
  412.  
  413. %       PLAIN's definition of \raggedright doesn't permit any stretch, and
  414. %       results in too many overfull boxes.  We also turn off hyphenation.
  415. \newdimen\raggedskip    \raggedskip=\z@
  416. \newdimen\raggedstretch \raggedstretch=5em    % ems of font set now (10pt)
  417. \newskip\raggedparfill  \raggedparfill=\z@ plus 1fil
  418.  
  419. \def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax }
  420. %       Some applications may have to add stretch, in order to avoid
  421. %       all overfull boxes.
  422.  
  423. \def\raggedright{%
  424.   \nohyphens
  425.   \rightskip=\raggedskip plus\raggedstretch \raggedspaces
  426.   \parfillskip=\raggedparfill }
  427. \def\raggedleft{%
  428.   \nohyphens
  429.   \leftskip=\raggedskip plus\raggedstretch \raggedspaces 
  430.   \parfillskip=\z@skip }
  431. \def\raggedcenter{%
  432.   \nohyphens
  433.   \leftskip=\raggedskip plus\raggedstretch
  434.   \rightskip=\leftskip \raggedspaces 
  435.   \parindent=\z@ \parfillskip=\z@skip }
  436.  
  437. \def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip }
  438.  
  439.  
  440. %       Miscellaneous useful stuff
  441.  
  442. \def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi}
  443.  
  444. %\def~{\penalty\@M \ } % tie -- this is PLAIN value; it is reset in AMS-TeX
  445. \def~{\unskip\nobreak\ \ignorespaces} % AMS-TeX value
  446.  
  447. \def\newbox{\alloc@4\box\chardef\insc@unt}   % remove \outer
  448. \def\boxcs#1{\box\csname#1\endcsname}
  449. \def\setboxcs#1{\setbox\csname#1\endcsname}
  450. \def\newboxcs#1{\expandafter\newbox\csname#1\endcsname}
  451.  
  452. \def\gobble#1{}
  453.  
  454. \def\vellipsis{%
  455.   \leavevmode\kern0.5em
  456.   \raise1pt\vbox{\baselineskip6pt\vskip7pt\hbox{.}\hbox{.}\hbox{.}}
  457.   }
  458.  
  459. \def\bull{\vrule height 1ex width .8ex depth -.2ex } % square bullet
  460. \def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}}
  461. \def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}
  462.  
  463. \def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
  464.                 /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}
  465. \def\sfrac#1/#2{\leavevmode\kern.1em
  466.         \raise.5ex\hbox{\the\scriptfont\z@ #1}\kern-.1em
  467.         /\kern-.15em\lower.25ex\hbox{\the\scriptfont\z@ #2}}
  468.  
  469. \def\thinskip{\hskip 0.16667em\relax}
  470. \def\endash{--}
  471. \def\emdash{\endash-}
  472. \def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
  473. \def\dash{\d@sh\nobreak\endash}
  474. \def\Dash{\d@sh\nobreak\emdash}
  475. \def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}}
  476. \def\rdash{\d@sh\nobreak\endash}
  477. \def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}}
  478. \def\Rdash{\d@sh\nobreak\emdash}
  479.  
  480. %       Hack to permit automatic hyphenation after an actual hyphen.
  481.  
  482. \def\hyph{-\penalty\z@\hskip\z@skip }
  483.  
  484. \def\slash{/\penalty\z@\hskip\z@skip }        % "breakable" slash
  485.  
  486. %  Adapted from c.t.t posting by Donald Arseneau, 26 May 93.
  487. \def\nth#1{\TestCount=#1\relax
  488.     \ifnum\TestCount <0 \multiply\TestCount by\m@ne \fi % subdue negatives
  489.     \T@stCount=\TestCount
  490.     \divide\T@stCount by 100 \multiply\T@stCount by 100
  491.     \advance\TestCount by-\T@stCount     % n mod 100
  492.     \ifnum\TestCount >20 \T@stCount=\TestCount
  493.       \divide\T@stCount by 10 \multiply\T@stCount by 10
  494.       \advance\TestCount by-\T@stCount   % n mod 10
  495.     \fi
  496.     \T@stCount=\the\fam\relax
  497.     $\fam\T@stCount#1^{\fam\T@stCount
  498.       \ifcase\TestCount th%    0th
  499.       \or   st%                1st
  500.       \or   nd%                2nd
  501.       \or   rd%                3rd
  502.       \else th%                nth
  503.       \fi
  504.      }$}
  505.  
  506.  
  507. %       Format information on reviewed items for book review articles.
  508.  
  509. \def\Review:#1{\ifx[#1\@Rev[%
  510.   \else Book review:\enspace\sl #1%
  511.   \fi
  512.   }
  513. \def\@Rev[#1]{\ignorespaces#1\unskip:\enspace\ignorespaces\sl}
  514. \def\reviewitem{%
  515.   \def\revauth##1{\def\therevauth{##1, }\ignorespaces}%
  516.   \def\revtitle##1{\def\therevtitle{{\sl##1}. }\ignorespaces}%
  517.   \def\revpubinfo##1{\def\therevpubinfo{##1.}\ignorespaces}%
  518.   }
  519. \def\endreviewitem{{\noindent\interlinepenalty=10000
  520.   \therevauth\therevtitle\therevpubinfo\endgraf}%
  521.   \vskip\medskipamount
  522.   \ifx\tugstyloaded@\plaintubstyle
  523.     \DeleteOptionalSpacesandPars{\noindent\ignorespaces}%
  524.   \fi
  525.   }
  526.  
  527. \def\booktitle#1{{\sl #1\/}}
  528.  
  529.  
  530. %       Dates and other items which identify the volume and issue
  531.  
  532. %       To use: \vol 5, 2.
  533. %               \issdate October 1984.
  534. %               \issueseqno=10
  535. %       For production, these are set in a separate file, TUGBOT.DATES,
  536. %       which is issue-specific.
  537.  
  538. \newcount\issueseqno            \issueseqno=-1
  539.  
  540. \def\v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}}
  541. \def\volyr{}
  542. \def\volno{}
  543. \def\vol #1,#2.{\gdef\volno{#1\unskip}%
  544.         \gdef\issno{\ignorespaces#2\unskip}%
  545.         \setbox\TestBox=\hbox{\volyr}%
  546.         \ifdim \wd\TestBox > .2em \v@lx \fi }
  547.  
  548. \def\issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}%
  549.         \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}%
  550.         \setbox\TestBox=\hbox{\volno}%
  551.         \ifdim \wd\TestBox > .2em \v@lx \fi }
  552.  
  553.  
  554. \vol 0, 0.                      % volume, issue.
  555. \issdate Thermidor, 2001.       % month, year of publication
  556.  
  557.  
  558. \ifx\tugstyloaded@\plaintubstyle
  559.   \def\tubissue#1(#2){\TUB~#1, no.~#2}
  560. \else
  561.   \def\tubissue#1#2{\TUB~#1, no.~#2}
  562. \fi
  563.  
  564. \def\xEdNote{{\tenuit Editor's note:\enspace }}
  565.  
  566.  
  567. %       TUGboat conventions include the issue number in the file name.
  568. %       Permit this to be incorporated into file names automatically.
  569. %       If issue number = 11, \Input filnam  will read tb11filnam.tex.
  570.  
  571.  
  572. \def\infil@{\jobname}
  573. \def\Input #1 {\ifnum\issueseqno<0 \def\infil@{#1}%
  574.                 \else \def\infil@{tb\number\issueseqno#1}\fi
  575.                 \edef\jobname{\infil@}\@readFLN
  576.                 \@@input \infil@\relax
  577.                 \ifRMKopen\immediate\closeout\TBremarkfile\RMKopenfalse\fi}
  578.  
  579. \newif\ifRMKopen        \RMKopenfalse
  580. \newwrite\TBremarkfile
  581. \def\TBremarkON#1{%
  582.   \ifRMKopen\else\RMKopentrue\immediate\openout\TBremarkfile=\infil@.rmk \fi
  583.   \toks@={#1}%
  584.   \immediate\write\TBremarkfile{^^J\the\toks@}%
  585.   \immediate\write16{^^JTBremark:: \the\toks@^^J}}
  586. \def\TBremarkOFF#1{}
  587. \let\TBremark=\TBremarkOFF
  588.  
  589. % for marking locations in articles that pertain to remarks
  590. % in another file of editorial comments
  591. \def\TUBedit#1{}
  592.  
  593. % for using different filenames in Providence than those supplied
  594. % by authors
  595.  
  596. \def\TUBfilename#1#2{\expandafter\def\csname file@@#1\endcsname{#2}}
  597. \newread\@altfilenames
  598. \def\@readFLN{\immediate\openin\@altfilenames=\jobname.fln
  599.   \ifeof\@altfilenames\let\@result\relax\else
  600.   \def\@result{\@@input\jobname.fln }\fi
  601.   \immediate\closein\@altfilenames
  602.   \@result}
  603. \@readFLN
  604. \everyjob=\expandafter{\the\everyjob\@readFLN}
  605.  
  606. % Following needs to work entirely in TeX's mouth
  607. \def\@tubfilename#1{\expandafter\ifx\csname file@@#1\endcsname\relax
  608.   #1\else\csname file@@#1\endcsname\fi}
  609.  
  610. \def\fileinput#1{\@@input\@tubfilename{#1} }
  611.  
  612. %       Write out (both to a file and to the log) the starting page number
  613. %       of an article, to be used for cross references and in contents.
  614. %       \pagexref  is used for articles fully processed in the TUGboat run.
  615. %       \PageXref  is used for "extra" pages, where an item is submitted
  616. %               as camera copy, and only running heads (at most) are run.
  617.  
  618. \ifx\tugstyloaded@\plaintubstyle
  619. \def\pagexrefON#1{%
  620.         \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
  621.         \write\ppoutfile{%
  622.                 \def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
  623.         }
  624. \def\PageXrefON#1{%
  625.         \immediate\write-1{\def\expandafter
  626.                         \noexpand\csname#1\endcsname{\number\pageno}}%
  627.         \immediate\write\ppoutfile{\def\expandafter
  628.                         \noexpand\csname#1\endcsname{\number\pageno}}}
  629. \else
  630. \def\pagexrefON#1{%
  631.         \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
  632.         \write\ppoutfile{%
  633.                 \def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
  634.         }
  635. \def\PageXrefON#1{%
  636.         \immediate\write-1{\def\expandafter
  637.                         \noexpand\csname#1\endcsname{\number\c@page}}%
  638.         \immediate\write\ppoutfile{\def\expandafter
  639.                         \noexpand\csname#1\endcsname{\number\c@page}}}
  640. \fi
  641.  
  642. \def\pagexrefOFF#1{}
  643. \let\pagexref=\pagexrefOFF
  644. \def\PageXrefOFF#1{}
  645. \let\PageXref=\PageXrefOFF
  646.  
  647. \def\xreftoON#1{%
  648.   \ifundefined{#1}%
  649.     ???\TBremark{Need cross reference for #1.}%
  650.   \else\csname#1\endcsname\fi}
  651. \def\xreftoOFF#1{???}
  652. \let\xrefto=\xreftoOFF
  653.  
  654. \def\TBdriver#1{}
  655.  
  656.  
  657. %  Authors, addresses, signatures
  658.  
  659. \def\theauthor#1{\csname theauthor#1\endcsname}
  660. \def\theaddress#1{\csname theaddress#1\endcsname}
  661. \def\thenetaddress#1{\csname thenetaddress#1\endcsname}
  662.  
  663. \newcount\count@@
  664. \def\@defaultauthorlist{%         % standard way of listing authors
  665.    \count@=\authornumber
  666.    \advance\count@ by -2
  667.    \count@@=0
  668.    \loop
  669.    \ifnum\count@>0
  670.       \advance\count@@ by 1
  671.       \ignorespaces\csname theauthor\number\count@@\endcsname\unskip,
  672.       \advance\count@ by -1
  673.    \repeat
  674.    \count@=\authornumber
  675.    \advance\count@ by -\count@@
  676.    \ifnum\authornumber>0
  677.      \ifnum\count@>1
  678.        \count@=\authornumber
  679.        \advance\count@ by -1   
  680.        \ignorespaces\csname theauthor\number\count@\endcsname\unskip\ and
  681.        \fi
  682.      \ignorespaces\csname theauthor\number\authornumber\endcsname\unskip
  683.    \fi
  684.   }
  685.  
  686. \def\signature#1{\def\@signature{#1}}
  687. \def\@signature{\@defaultsignature}
  688.  
  689. \def\@defaultsignature{%
  690.   \count@=0
  691.   \loop
  692.   \ifnum\count@<\authornumber
  693.     \medskip
  694.     \advance\count@ by \@ne
  695.     \signaturemark
  696.     \theauthor{\number\count@}\\
  697.     \leavevmode\theaddress{\number\count@}\\
  698.     \leavevmode\thenetaddress{\number\count@}\\
  699.   \repeat
  700.   }
  701.  
  702. \newdimen\signaturewidth   \signaturewidth=12pc
  703. \def\makesignature{%
  704.   \par
  705.   \penalty9000
  706.   \vskip\medskipamount
  707.   \rightline{%
  708.     \vbox{\hsize\signaturewidth \ninepoint \raggedright
  709.       \parindent \z@ \everypar={\hangindent 1pc }
  710.       \parskip \z@skip
  711.       \netaddrat
  712.       \netaddrpercent
  713.       \def\|{\unskip\hfil\break}%
  714.       \def\\{\endgraf}%
  715.       \def\net{\tt}%
  716.       \def\phone{\rm Phone: } \rm
  717.       \@signature}}
  718.   }
  719.  
  720. {\makeactive\@
  721.  \gdef\signatureat{\makeactive\@\def@{\char"40\discretionary{}{}{}}}
  722.  \makeactive\%
  723.  \gdef\signaturepercent{\makeactive\%\def%{\char"25\discretionary{}{}{}}}
  724. }
  725.  
  726. \def\signaturemark{\leavevmode\llap{$\diamond$\enspace}}
  727.  
  728.  
  729.  
  730.  
  731. %       some hyphenation exceptions:
  732. \hyphenation{Eijk-hout man-u-script man-u-scripts}
  733.  
  734.  
  735. \restorecat\@
  736.  
  737. \endinput
  738.  
  739.  
  740. % *************************************************************************
  741.  
  742. Contents and Notes
  743. ------------------
  744.  
  745. \makeescape, ..., \makecomment allow users to change category
  746. codes a little more easily.
  747.  
  748. \savecat#1 and \restorecat#1 will save and restore the category
  749. of a given character.  These are useful in cases where one doesn't
  750. wish to localize the settings and therefore be required to globally
  751. define or set things.
  752.  
  753. \SaveCS#1 and \RestoreCS#1 save and restore `meanings' of control
  754. sequences.  Again this is useful in cases where one doesn't want to
  755. localize or where global definitions clobber a control sequence which
  756. is needed later with its `old' definition.
  757.  
  758. Abbreviations.  Just a listing with indications of expansion where
  759. that may not be obvious.  For full definitions, see real code above.
  760.  
  761. \AllTeX         (\La)\TeX
  762. \AMS            American Mathematical Society
  763. \AmSTeX
  764. \aw             A-W (abbreviation for Addison-Wesley)
  765. \AW             Addison-Wesley
  766. \BibTeX
  767. \CandT          Computers \& Typesetting
  768. \DVItoVDU       DVItoVDU
  769. \HTML        HTML
  770. \ISBN           ISBN
  771. \JTeX
  772. \JoT            The Joy of \TeX
  773. \LaTeX
  774. \Mc             M ``w/ raised c''
  775. \MF             METAFONT
  776. \mf             Metafont (using small caps)
  777. \MFB            The Metafont book
  778. \MP             METAPOST
  779. \mtex           multilingual TeX
  780. \pcMF           pcMF
  781. \PCTeX
  782. \pcTeX
  783. \Pas            Pascal
  784. \PDF        PDF
  785. \PiCTeX
  786. \plain          plain (in typewriter font)
  787. \POBox          P. O. Box
  788. \POBoxTUG       TUG PO Box
  789. \PS             PostScript
  790. \SC             Steering Committee
  791. \SGML           SGML
  792. \SliTeX
  793. \slMF           Metafont (slanted)
  794. \stTeX          TeX for the Atari ST
  795. \TANGLE
  796. \TB             The \TeX book
  797. \TeX
  798. \TeXhax
  799. \TeXMaG
  800. \TeXtures
  801. \TeXXeT
  802. \TUB            TUGboat
  803. \TUG            TeX Users Group
  804. \UNIX
  805. \VAX
  806. \VorTeX
  807. \XeT
  808. \WEB
  809. \WEAVE
  810.  
  811. \NoBlackBoxes           turns off marginal rules marking overfull boxes
  812. \BlackBoxes             turns them back on
  813. \newline                horizontal glue plus a break
  814.  
  815. \ifundefined#1          checks argument with \csname against \relax
  816.  
  817. \topsmash               smashes above baseline  (from AMSTeX)
  818. \botsmash               smashes below baseline  (from AMSTeX)
  819. \smash                  smashes both            (from plain)
  820.  
  821. \ulap                   lap upwards
  822. \dlap                   lap downwards
  823. \xlap                   reference point at center horizontally; 0 width
  824. \ylap                   reference point at center vertically; 0 height, depth
  825. \zlap                   combination \xlap and \ylap
  826.  
  827. \basezero               to avoid insertion of baselineskip and lineskip glue
  828.  
  829. \nullhrule              empty \hrule
  830. \nullvrule              empty \vrule
  831.  
  832. \makestrut[#1;#2]       ad hoc struts;  #1=height, #2=depth
  833.  
  834. \today                  today's date
  835. \SetTime                converts \time to hours, minutes
  836. \now                    displays time in hours and minutes
  837. \Now                    shows current date and time
  838.  
  839. \ifPrelimDraft          flag to indicate status as preliminary draft
  840.  
  841. \rtitlex                TUGboat volume and number info for running head
  842. \midrtitle              information for center of running head
  843.  
  844. \HorzR@gisterRule       pieces of registration marks ("trimmarks")
  845. \DownShortR@gisterRule
  846. \UpShortR@gisterRule
  847.  
  848. \ttopregister           top registration line with `T' in center
  849. \tbotregister           bottom registration line with inverted `T' in center
  850. \topregister            register actually used
  851. \botregister
  852.  
  853.  
  854. \raggedskip             parameters used for ragged settings
  855. \raggedstretch
  856. \raggedparfill
  857. \raggedspaces
  858.  
  859. \raggedright
  860. \raggedleft
  861. \raggedcenter
  862. \normalspaces
  863. \raggedbottom
  864.  
  865. \bull                   square bullet
  866. \cents                  ``cents'' sign
  867. \Dag                    superscripted dagger
  868. \careof                 c/o
  869. \sfrac                  slashed fraction
  870.  
  871. \dash                   en-dash surrounded by thinspaces; only breakable AFTER
  872. \Dash                   em-dash, as above
  873.  
  874. \hyph                   permit automatic hyphenation after an actual hyphen
  875.  
  876. \slash                  "breakable" slash
  877. \nth                    for obtaining "1^{st}", "2^{nd}", 3^{rd}, etc.
  878.  
  879. \tubissue               gets \TUB followed by volume and issue numbers
  880.  
  881. \xEdNote                Editor's Note:
  882.  
  883. \Review:                Review: (for title of book review article)
  884. \reviewitem             begin data for item being reviewed
  885.   \revauth              with one argument, author(s) of item being reviewed
  886.   \revtitle             with one argument, title of ...
  887.   \revpubinfo           with one argument, other info pertaining to ...
  888. \endreviewitem          end data for item being reviewed
  889. \booktitle              with one argument, format book title in text
  890.  
  891. \Input                  \input with some other bookkeeping for
  892.                         case where multiple articles are put together
  893.  
  894. \TBremark               reminder to TUGboat editorial staff
  895. \TBremarkON
  896. \TBremarkOFF
  897.  
  898. \pagexref               used to write out page numbers to screen and
  899. \pagexrefON             external files
  900. \pagexrefOFF
  901. \PageXref
  902. \PageXrefON
  903. \PageXrefOFF
  904.  
  905. \xrefto                 used for symbolic cross-reference to other pages
  906. \xreftoON               in TUGboat
  907. \xreftoOFF
  908.  
  909. \TBdriver               marks code which only takes effect when articles
  910.                         are run together in a driver file
  911.  
  912. \signatureat            items for signatures
  913. \signaturepercent
  914. \signaturemark
  915. \signaturewidth
  916.  
  917.  
  918. % *************************************************************************
  919.  
  920. % Change history
  921.  
  922. Version   Date        Changes
  923. -------   ---------   ---------------------------------------------------
  924. 1.13h     10 Nov 95   added \acro and converted all \SMC entries to use it
  925.               added acronyms \HTML and \PDF
  926.  
  927. 1.13g      4 Nov 95   added \MP for METAPOST
  928.  
  929. 1.13f     15 Apr 94   added \@Rev[...] to permit variable text for reviews
  930.  
  931. 1.13e     14 Mar 94   revised definition of \La to use actual width of A
  932.                       added \LaTeXe definition
  933.  
  934. 1.13d      5 Jan 94   added {} to \TeX-{}-\Xet
  935.  
  936. 1.13c     11 Nov 93   removed extraneous " from header
  937.                       added \AmSLaTeX, \CTAN, \ISSN
  938.  
  939. 1.13b      4 Nov 93   added \hyphenation{Eijk-hout}
  940.  
  941. 1.13a     18 Aug 93   corrected \nth to produce ordinal in current font
  942.  
  943. 1.13      27 May 93   upgraded \nth based on algorithm by Donald Arseneau
  944.                         in comp.text.tex, 26 May 93
  945.  
  946. 1.12      19 Feb 93   added \spacefactor1000 to all replacement text that ends
  947.                         with a capital letter, so that if these items end a
  948.                         sentence, there will be a normal end-of-sentence space
  949.                       removed \hbox from definitions of \TeX, etc.; no longer
  950.                         needed
  951.                       changed definition of \TeXXeT to use \XeT rather than
  952.                         unique dimensions
  953.                       installed new TUG address and phone number in header
  954.                       reformatted change history, similar to tugboat.sty
  955.  
  956. 1.11c     29 Nov 92   added macros to format book review and related items for
  957.                         review articles
  958.                       added \SGML
  959.                       changed def of \UNIX to use \SMC rather than \smc
  960.  
  961. 1.11b     20 Oct 92   added font code for \ISBN font ("big small caps")
  962.                       added \Textures as the current form
  963.  
  964. 1.11a      6 Jun 92   added \drawoutlinebox
  965.  
  966. 1.11      15 Mar 92   added \ttn and \TTN
  967.  
  968. 1.10       8 Mar 92   added \AllTeX
  969.                       changed file name from .COM to .CMN to avoid objection
  970.                         that .COM files have a special significance on DOS
  971.                         and other operating systems
  972.                       added standard headers, prepared for archive installation
  973.  
  974. 1.09       5 May 91   inserted large penalty at top of \makesignature to
  975.                         inhibit break between article and signature
  976.  
  977. 1.08      24 Oct 90   modified signature slightly (took \medskip out of box)
  978.                       fixed bug in previous rendition of \@readFLN
  979.  
  980. 1.07      16 Oct 90   added \TUBedit to facilitate editorial marking
  981.                       added \iinput variant from LaTeX; \input redefined now
  982.                         as with LaTeX
  983.                       added mechanism for local file names in Providence
  984.                         (\TUBfilename, \fileinput, etc.)
  985.                       \tugstyload@ defaults to plain if it's not defined
  986.  
  987. 1.06       3 Aug 90   added \leavevmode to \@defaultsignature so that
  988.                         \everypar is not executed inside a group
  989.                       dash routines modified and corrected (to suppress
  990.                         insertion of discretionary node after -- and ---;
  991.                         and to allow hyphenation of ensuing word)
  992.                       changed \lDash to \Ldash and \rDash to \Rdash
  993.  
  994. 1.05      29 Mar 90   added \lDash and \rDash for `parenthetical' dashing
  995.                       added \TP for TeX: The Program
  996.                       added \relax after file input of \Input
  997.                       added \relax before \ifmmode of \,
  998.  
  999. 1.04      28 Feb 90   modified pagexref macros to work in both plain and
  1000.                         latex styles (this should NOT affect authors)
  1001.  
  1002. 1.03      26 Feb 90   removed <tab>s and adjusted definition of \slMF
  1003.  
  1004. 1.02      25 Feb 90   added definitions of \plaintubissue, \latextubissue
  1005.                       added definition of \tubissue
  1006.  
  1007. 1.01      19 Feb 90   added \signaturewidth to allow for modification
  1008.                       added \nth to obtain 1^{st}, etc.
  1009.